#!
$FileName = "files\\file.txt";
open (F,$FileName) || die "Can not open $FileName: $!\n";
@contents = <F>;
close F;
$NewFileName = "files\\newfile.txt";
open (NEWF,">$NewFileName")|| die "can not open $NewFileName: $!\n";
print NEWF "following is the contents of file $FileName:\n", @contents;
close NEWF;